

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">
<head id="Head1">
<link rel="shortcut icon" href="/favicon.ico" />
<meta name="Keywords" content="足球直播" />
<meta name="Description" content="足球直播" />
<link href="__PUBLIC__/user/css/BasicStyle.css" rel="stylesheet"
	type="text/css" />
<link href="__PUBLIC__/user/css/CommonStyle.css" rel="stylesheet"
	type="text/css" />

<title>足球直播</title>
<link href="__PUBLIC__/user/css/SubscribePage.css" rel="stylesheet"
		type="text/css" />
<link href="__PUBLIC__/user/css/matrix-style.css" rel="stylesheet"
		type="text/css" />
<link href="__PUBLIC__/user/css/bootstrap.min.css" rel="stylesheet"
		type="text/css" />
<script src='https://cdn.bootcss.com/socket.io/2.0.3/socket.io.js'></script>
<script src='//cdn.bootcss.com/jquery/1.11.3/jquery.js'></script>
<script src='__PUBLIC__/home/js/notify.js'></script>
</head>
<body>
	<form method="post" action="__CONTROLLER__/pay_post" id="form1">

		<div>
			<div id="Main">
				<div>
					
				</div>

				<div id="container">
					<div class="content">
						<div class="head">
							<div class="serviceinfo">
								<span>即时比分:</span>
							</div>
						</div>
						<div style="margin: 10px;" id="content_head">
							<table class="table table-bordered table-striped with-check">
								<thead>
									<tr>
										<th width="60px;">序号</th>
										<th>{$date}</th>
										<th>KO时间</th>
										<th>主场球队</th>
										<th>比分</th>
										<th>客场球队</th>
										<th>半场</th>
										<th>主</th>
										<th>让球</th>
										<th>客</th>
									</tr>
								</thead>
								<tbody>
									<volist name="list" id="v">
									<tr>
										<td width="60px;">{$key+1}</td>
										<td>{$v[0]}</td>
										<td>{$v[3]}<if condition="$v[4] neq null">'<img src="__PUBLIC__/home/images/s1bg.gif" /></if></td>
										<td>{$v[5]}
										<!-- <if condition="$v[27] neq null">[{$v[27]}]</if> -->
										</td>
										<td>{$v[11]}-{$v[12]}</td>
										<td>{$v[6]}<!-- <if condition="$v[28] neq null">[{$v[28]}]</if> --></td>
										<td>{$v[13]}</td>
										<td>{$v[21]}</td>
										<td>{$v[22]}</td>
										<td>{$v[23]}</td>
									</volist>
								</tbody>
							</table>
						</div>

					</div>
				</div>
			</div>
		</div>
	</form>
	
<script>
$(document).ready(function () {
	var uid = Date.parse(new Date());
    // 连接服务端
    var socket = io('http://'+document.domain+':2120');
    // 连接后登录
    socket.on('connect', function(){
    	//触发服务端connect里面的login事件
    	socket.emit('login', uid);
    });
    // 后端推送来消息时
    socket.on('new_msg', function(msg){
    	var re=msg.replace(/<\/?.+?>/g,"");
    	var data_str=re.replace(/ /g,"");
    	var data_arr=data_str.split("!"); //字符分割 
    	var act01path = "";
    	act01path += "<table class='table table-bordered table-striped with-check'><thead>"+
    	"<tr><th width='60px;'>序号</th><th>{$date}</th><th>KO时间</th><th>主场球队</th><th>比分</th>"+
    	"<th>客场球队</th><th>半场</th><th>主</th><th>让球</th><th>客</th></tr></thead><tbody>";
    	
    	for(var i=0;i<data_arr.length;i++){
    		var data_vo=data_arr[i].split(",")//一行数据
    		act01path += "<tr><td width='60px;'>"+i+"</td>";
    		act01path += "<td>"+data_vo[0]+"</td>";
    		if(data_vo[4]){
    			act01path +="<td>"+data_vo[3]+"<img src='__PUBLIC__/home/images/s1bg.gif' /></td>"
    		}else{
    			act01path += "<td>"+data_vo[3]+"</td>";
    		}
    		act01path += "<td>"+data_vo[5]+"</td>";
    		act01path += "<td>"+data_vo[11]+"-"+data_vo[12]+"</td>";
    		act01path += "<td>"+data_vo[6]+"</td>";
    		act01path += "<td>"+data_vo[13]+"</td>";
    		act01path += "<td>"+data_vo[21]+"</td>";
    		act01path += "<td>"+data_vo[22]+"</td>";
    		act01path += "<td>"+data_vo[23]+"</td></tr>";
    	}
    	act01path += "</tbody></table>";
    	$("#content_head").html(act01path);

     });
    // 后端推送来消息时
    socket.on('update', function(msg){
         
    });
    // 后端推送来在线数据时
    socket.on('update_online_count', function(online_stat){
        $('#online_box').html(online_stat);
    });
});
</script>	

</body>
</html>
